package com.yss.reportworld.enums;

import com.yss.common.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * 系统常量
 *
 * @author lsl
 */
@Getter
@AllArgsConstructor
public enum ReportWorldDescriptionEnum implements BaseEnum<String> {
    BACKUPVERSION("BACKUPVERSION", "报表世界备份表信息"),
    COMPARECONFIG("COMPARECONFIG", "版本工具策略文件");

    private final String code;
    private final String desc;

    public static ReportWorldDescriptionEnum getEnum(String code) {
        return Arrays.stream(values()).filter(b -> Objects.equals(b.code, code)).findFirst().orElse(null);
    }

    public static String getEnumDesc(String code) {
        ReportWorldDescriptionEnum e = getEnum(code);
        return e != null ? e.desc : null;
    }
}
